package com.sweet.fourtimeoa.mapper;

import com.sweet.fourtimeoa.pojo.entity.VehicleManagement;
import com.sweet.fourtimeoa.pojo.entity.VehicleUsage;
import com.sweet.fourtimeoa.pojo.vo.CarVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CarMapper {

    @Select("select id,vehicle_number,vehicle_type,capacity from vehicle_management")
     List<VehicleManagement> getAllCar( );

    @Select("delete from vehicle_management where id = #{carId}")
    void deleteCarById(Integer carId);

    @Select("select id,vehicle_number,vehicle_type,capacity from vehicle_management where id = #{carId}")
    VehicleManagement getCarById(Integer carId);

    void updateCar(VehicleManagement vehicleManagement);


    void saveCar(VehicleManagement vehicleManagement);

    void saveCarManage(VehicleUsage vehicleUsage);

    @Select("select id,vehicle_number from vehicle_management")
    List<CarVo> getAllCarId();
}
